using System;
using System.Linq;
using TestMonkey.Models;

namespace TestMonkey.Templates
{
    public class PropertySelfAssign : TemplateProcessor
    {
        protected override bool ShouldRun(ModelRoot model)
        {
            if (model == null)
                throw new ArgumentNullException("model", "model is null.");

            return model.Type.HasConstructors() && model.Class.Properties.Any(p => !p.IsIndexer && p.CanRead && p.CanWrite);
        }

    }
}